<?php

namespace app\serverbankcard\service\bankcard;
use \app\manage\service\ApiBase;

/**
 * @author:      李颖
 * @DateTime:    2017-08-30 10:35:31
 * @Description: 银行卡管理
 */

class Bankcard extends ApiBase{
	
	protected $bankcardLogic = '\app\serverbankcard\logic\Bankcard';
    protected $bankcardValidate = '\app\serverbankcard\validate\Bankcard';

    /*我的 - 添加银行卡*/
    public function addCard(): array 
    {
    	$data = $this->haveIssetReceiveData(['user_id'=>0,'account'=>' ','name'=>' ','name_en'=>' ','type'=>' ','number'=>' ', 'phone_no'=>'', 'cvn2'=>'', 'valid_date'=>'']);
    	return $this->stepRun($data, 'addCard', '', $this->bankcardValidate, $this->bankcardLogic);
    }

    /*我的 - 所有银行卡列表*/
    public function userCardList(): array 
    {
    	$data = $this->haveIssetReceiveData(['user_id'=>0,'status'=>''], ['']);
    	return $this->stepRun($data, 'userCardList', '', $this->bankcardValidate, $this->bankcardLogic);
    }

    /*后台 - 获取银行卡列表（分页数据）*/
    public function cardList(): array 
    {
    	$data = $this->haveIssetReceiveData(['page'=>1, 'listRows'=>15, 'status'=>'', 'keywords'=>''], ['']);
    	return $this->stepRun($data, 'cardList', '', $this->bankcardValidate, $this->bankcardLogic);
    }

    /*我的 - 删除银行卡*/
    public function delCard(): array 
    {
    	$data = $this->haveIssetReceiveData(['id'=>0,'user_id'=>0]);
    	return $this->stepRun($data, 'delCard', '', $this->bankcardValidate, $this->bankcardLogic);
    }

    /*后台 - 删除银行卡*/
    public function AdminDelCard(): array 
    {
    	$data = $this->haveIssetReceiveData(['id'=>0]);
    	return $this->stepRun($data, 'delCard', '', $this->bankcardValidate, $this->bankcardLogic);
    }

    /*后台 - 审核银行卡*/
    public function audit(): array 
    {
    	$data = $this->haveIssetReceiveData(['id'=>0, 'status'=>' ']);
    	return $this->stepRun($data, 'audit', '', $this->bankcardValidate, $this->bankcardLogic);
    }

    /*获取我的某一张银行卡*/
    public function userCardInfo(): array 
    {
        $data = $this->haveIssetReceiveData(['id'=>0, 'user_id'=>0, 'status'=>''], []);
        return $this->stepRun($data, 'userCardInfo', '', $this->bankcardValidate, $this->bankcardLogic);
    }

    
    

}